package com.foreverwin.jzymes.report.point.controller;

import com.foreverwin.jzymes.common.util.CommonMethods;
import com.foreverwin.jzymes.framework.base.AjaxResult;
import com.foreverwin.jzymes.framework.base.BaseController;
import com.foreverwin.jzymes.framework.exception.BusinessException;
import com.foreverwin.jzymes.production.picking.domain.PickingBillLog;
import com.foreverwin.jzymes.production.picking.domain.PickingBom;
import com.foreverwin.jzymes.qc.point.domain.PointChecklist;
import com.foreverwin.jzymes.report.point.service.IPointCheckReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;


@RestController
@RequestMapping("/report/point")
public class PointCheckReportController extends BaseController {

    @Autowired
    IPointCheckReportService pointCheckReportService;

    /**
     * 点检报表查询
     * @param jsonMap
     * @return
     */
    @RequestMapping("/findPointCheck")
    public  AjaxResult  PickingReport(@RequestParam Map<String,Object> jsonMap ){
        try{
          List<PointChecklist> rtnList = pointCheckReportService.findPointCheckReport( jsonMap );

            return AjaxResult.returnSuccess().put("value" , rtnList);
        }catch ( BusinessException e ){
            return AjaxResult.returnError( e.getMessage() );
        }
    }

    /**
     * 领料明细查询
     * @param type
     * @return
     */
    @RequestMapping("/findNumber")
    public  AjaxResult  findPickingBom(@RequestParam String type ){
        try{
            List< Map<String,Object> > rtnList = pointCheckReportService.findNumber( type );
            return AjaxResult.returnSuccess().put("value" , rtnList);
        }catch ( BusinessException e ){
            return AjaxResult.returnError( e.getMessage() );
        }
    }

}
